Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py2.py3] add function to coerce strings to six.binary_type #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anthrotype
Copy link

@anthrotype anthrotype commented Mar 24, 2018

This patch is required to run python-autopxd on python3, as well as to python2.7 when a header file contains some non-ascii character.

python-autopxd already requires six, however the new ensure_binary function is currently only in the six git repository and hasn't been released to PyPI yet, therefore I temporarily copied it here.

The source comes from: benjaminp/six#204

It's a trivial function (every py2.py3 project has its own way to do the same thing).

Fixes #12
Supersedes #3

python-autopxd already requires six, but the new `ensure_binary`
function is only in the git repo and hasn't been released to PyPI yet,
so I temporarily copied it here.

The source comes from:
benjaminp/six#204

It's a trivial function (every py2.py3 project has its own way to do
the same thing).

Fixes tarruda#12
Supersedes tarruda#3
@anthrotype
Copy link
Author

(sorry for the typos, pressed the button too early ;)

@anthrotype
Copy link
Author

I'm using UTF-8 as default encoding, which is also the one implied by the line
https://github.com/tarruda/python-autopxd/blob/b75f8711b3a870d9739846e91ee1f22df4df8578/autopxd/__init__.py#L319\

in 2018 I think it's ok to assume that text files will be encoded in utf-8. If we really care, we could add an --encoding command line option.

on py2, stdout is a bytes stream, on py3 it is a unicode text stream
@gabrieldemarmiesse
Copy link

Hello, I used your nice fix in https://github.com/gabrieldemarmiesse/python-autopxd2.
Would you like me to mention you in the contributors of the projects?

@anthrotype
Copy link
Author

@gabrieldemarmiesse thanks, but why did you have to fork? Is the upstream project unmaintained?

@tarruda maybe you could add @gabrieldemarmiesse as a collaborator if you don't have time to maintain this any more, so he could give you a hand?

@gabrieldemarmiesse
Copy link

It seems there are quite a few unresolved issues in this repo. That's why I assumed it wasn't maintained. But I have the time to maintain it if I am a colaborator. I would then drop the fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants